<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>轻聘-我的发布</title>
    <link rel="icon" href="../../../imgs/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="../../../plugins/layui/css/layui.css">
    <link rel="stylesheet" href="../../../css/employer/recruitment/recruitment_post.css">

</head>

<body>
    <div class="layui-content-fluid">
        <div class="layui-row">
            <ul class="layui-nav layui-nav-tree layui-nav-side" lay-filter="test">
                <li class="layui-nav-item">
                    <a href="javascript:;"><img src="../../../imgs/avatar.jpeg" class="layui-nav-img">刘文秀</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../employer_index.html">我的主页</a></dd>
                        <dd><a href="../../login/login1.html">切换为求职者</a></dd>
                        <dd><a href="../../login/login_enterprise1.html">退出登录</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item layui-nav-itemed">
                    <a href="javascript:;">我的招聘</a>
                    <dl class="layui-nav-child">
                        <dd><a href="./recruitment_post.html" class="layui-this">我的发布</a></dd>
                        <dd><a href="./new_recruitment.html">新的职位</a></dd>
                        <dd><a href="./recruitment_data.html">招聘数据</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">简历中心</a>
                    <dl class="layui-nav-child">
                        <dd><a href="../resume/unprocessed_resume.html">未处理简历</a></dd>
                        <dd><a href="../resume/processed_resume.html">已处理简历</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
    <div class="layui-content-fluid">
        <div class="layui-row">
            <div class="mypost">
                <h2>我的发布</h2>
                <table class="layui-hide" id="post" lay-filter="post"></table>
            </div>
        </div>
    </div>


    <script src="../../../plugins/layui/layui.js"></script>
    <script type="text/html" id="toolbarDemo">
        <div class="layui-btn-group">
            <button class="layui-btn layui-btn-sm" lay-event="add"><i class="layui-icon">&#xe654;</i>新增</button>
            <button class="layui-btn layui-btn-sm" lay-event="view"><i class="layui-icon">&#xe67b;</i>查看</button>
            <button class="layui-btn layui-btn-sm" lay-event="update"><i class="layui-icon">&#xe642;</i>修改</button>
            <button class="layui-btn layui-btn-sm" lay-event="delete"><i class="layui-icon">&#xe640;</i>删除</button>
            <button class="layui-btn layui-btn-sm" lay-event="refresh"><i class="layui-icon">&#xe666;</i>刷新</button>
        </div>
    </script>

    <script type="text/javascript">

        layui.use(["table", "form"], function () {
            let table = layui.table;
            table.render({
                elem: '#post',
                title: '职位管理',
                data: [
                    {
                        "serial_number": 1,
                        "id": 1,
                        "name": "Java工程师",
                        "salary": "6k-12k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-07-16 00:00:00",
                        "frequency": 0
                    }, {
                        "serial_number": 2,
                        "id": 4,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 21
                    }, {
                        "serial_number": 3,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                    , {
                        "serial_number": 4,
                        "id": 4,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 21
                    }, {
                        "serial_number": 5,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                    , {
                        "serial_number": 6,
                        "id": 4,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 21
                    }, {
                        "serial_number": 7,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                    , {
                        "serial_number": 8,
                        "id": 4,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 21
                    }, {
                        "serial_number": 9,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                    , {
                        "serial_number": 10,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                    , {
                        "serial_number": 6,
                        "id": 4,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 21
                    }, {
                        "serial_number": 7,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                    , {
                        "serial_number": 8,
                        "id": 4,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 21
                    }, {
                        "serial_number": 9,
                        "id": 8,
                        "name": "Java工程师",
                        "salary": "10k-16k",
                        "contact_name": "刘文秀",
                        "contact_phone": "14796847179",
                        "contact_email": "2294014200@qq.com",
                        "release_time": "2021-09-16 00:00:00",
                        "frequency": 40
                    }
                ],
                height: "625px",
                toolbar: '#toolbarDemo',
                page: true,
                limit: 10,
                cols: [[
                    { type: 'checkbox', fixed: 'left' },
                    { field: 'serial_number', title: '序号' , width: 80, sort: true },
                    { field: 'id', hide: true, title: 'id' },
                    { field: 'name', title: '名称' },
                    { field: 'salary', title: '薪资' },
                    { field: 'contact_name', title: '联系人' },
                    { field: 'contact_phone', title: '联系电话' },
                    { field: 'contact_email', title: '联系邮箱' },
                    { field: 'release_time', title: '发布时间',width:200 },
                    { field: 'frequency', title: '浏览次数'}
                ]]
            });

            table.on('toolbar(post)', function (obj) {
                console.log(obj.event);
                if (obj.event == 'add') {
                    window.location.href = "new_recruitment.html";
                } else if (obj.event == 'view') {
                    window.location.href = "my_recruitment.html";
                } else if (obj.event == 'update') {
                    window.location.href = "edit_recruitment.html";
                } else if (obj.event == 'delete') {
                    alert("delete");
                } else if (obj.event == 'refresh') {
                    alert("refresh");
                }
            });
        });



    </script>
</body>

</html>